\hypertarget{class_q_c_p_item_line}{}\section{Q\+C\+P\+Item\+Line Class Reference}
\label{class_q_c_p_item_line}\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}


A line from one point to another.  


Inheritance diagram for Q\+C\+P\+Item\+Line\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=4.000000cm]{class_q_c_p_item_line}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_q_c_p_item_line_a17804b7f64961c6accf25b61e85142e3}{Q\+C\+P\+Item\+Line}} (\mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} $\ast$parent\+Plot)
\item 
\mbox{\Hypertarget{class_q_c_p_item_line_a712e5a7f59db3f4c588dfc370a63e225}\label{class_q_c_p_item_line_a712e5a7f59db3f4c588dfc370a63e225}} 
Q\+Pen {\bfseries pen} () const
\item 
\mbox{\Hypertarget{class_q_c_p_item_line_ae1782c4fbecd38054ec3d49d8572a5e5}\label{class_q_c_p_item_line_ae1782c4fbecd38054ec3d49d8572a5e5}} 
Q\+Pen {\bfseries selected\+Pen} () const
\item 
\mbox{\Hypertarget{class_q_c_p_item_line_a6cdc9e87e17418d4b0e66eaa0f041407}\label{class_q_c_p_item_line_a6cdc9e87e17418d4b0e66eaa0f041407}} 
\mbox{\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending}} {\bfseries head} () const
\item 
\mbox{\Hypertarget{class_q_c_p_item_line_ac085d3939ec11d7a4d592dc2ed578360}\label{class_q_c_p_item_line_ac085d3939ec11d7a4d592dc2ed578360}} 
\mbox{\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending}} {\bfseries tail} () const
\item 
void \mbox{\hyperlink{class_q_c_p_item_line_a572528dab61c1abe205822fbd5db4b27}{set\+Pen}} (const Q\+Pen \&pen)
\item 
void \mbox{\hyperlink{class_q_c_p_item_line_a3e2fec44503277e77717e9c24f87f1ea}{set\+Selected\+Pen}} (const Q\+Pen \&pen)
\item 
void \mbox{\hyperlink{class_q_c_p_item_line_aebf3d687114d584e0459db6759e2c3c3}{set\+Head}} (const \mbox{\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending}} \&head)
\item 
void \mbox{\hyperlink{class_q_c_p_item_line_ac264222c3297a7efe33df9345c811a5f}{set\+Tail}} (const \mbox{\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending}} \&tail)
\item 
virtual double \mbox{\hyperlink{class_q_c_p_item_line_ae6cc5183f568e5fa9d7827abe4d405b5}{select\+Test}} (const Q\+PointF \&pos, bool only\+Selectable, Q\+Variant $\ast$details=0) const
\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_q_c_p_item_line_a602da607a09498b0f152ada1d6851bc5}\label{class_q_c_p_item_line_a602da607a09498b0f152ada1d6851bc5}} 
\mbox{\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position}} $\ast$const {\bfseries start}
\item 
\mbox{\Hypertarget{class_q_c_p_item_line_a15598864c1c22a2497a1979c4980c4e1}\label{class_q_c_p_item_line_a15598864c1c22a2497a1979c4980c4e1}} 
\mbox{\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position}} $\ast$const {\bfseries end}
\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_q_c_p_item_line_a1fc045dd33919f8006df0692aeb0e84a}\label{class_q_c_p_item_line_a1fc045dd33919f8006df0692aeb0e84a}} 
virtual void {\bfseries draw} (\mbox{\hyperlink{class_q_c_p_painter}{Q\+C\+P\+Painter}} $\ast$painter)
\item 
\mbox{\Hypertarget{class_q_c_p_item_line_ae61e504ad3b94aa86bfd02f734fb17b0}\label{class_q_c_p_item_line_ae61e504ad3b94aa86bfd02f734fb17b0}} 
Q\+LineF {\bfseries get\+Rect\+Clipped\+Line} (const Q\+Vector2D \&start, const Q\+Vector2D \&end, const Q\+Rect \&rect) const
\item 
\mbox{\Hypertarget{class_q_c_p_item_line_af8b5370462515b279578d8b4a57bd3b4}\label{class_q_c_p_item_line_af8b5370462515b279578d8b4a57bd3b4}} 
Q\+Pen {\bfseries main\+Pen} () const
\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_q_c_p_item_line_abbb544d5bb927dfe4e81a7f3ca4c65ac}\label{class_q_c_p_item_line_abbb544d5bb927dfe4e81a7f3ca4c65ac}} 
Q\+Pen {\bfseries m\+Pen}
\item 
\mbox{\Hypertarget{class_q_c_p_item_line_aff858ad6dde3b90024814ca4b116f278}\label{class_q_c_p_item_line_aff858ad6dde3b90024814ca4b116f278}} 
Q\+Pen {\bfseries m\+Selected\+Pen}
\item 
\mbox{\Hypertarget{class_q_c_p_item_line_a51603f28ab7ddb1c1a95ea384791d3ed}\label{class_q_c_p_item_line_a51603f28ab7ddb1c1a95ea384791d3ed}} 
\mbox{\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending}} {\bfseries m\+Head}
\item 
\mbox{\Hypertarget{class_q_c_p_item_line_ab8ed61dfe15bbb1cbf9b95eae95e242f}\label{class_q_c_p_item_line_ab8ed61dfe15bbb1cbf9b95eae95e242f}} 
\mbox{\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending}} {\bfseries m\+Tail}
\end{DoxyCompactItemize}
\subsection*{Additional Inherited Members}


\subsection{Detailed Description}
A line from one point to another. 

 It has two positions, {\itshape start} and {\itshape end}, which define the end points of the line.

With \mbox{\hyperlink{class_q_c_p_item_line_aebf3d687114d584e0459db6759e2c3c3}{set\+Head}} and \mbox{\hyperlink{class_q_c_p_item_line_ac264222c3297a7efe33df9345c811a5f}{set\+Tail}} you may set different line ending styles, e.\+g. to create an arrow. 

\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_q_c_p_item_line_a17804b7f64961c6accf25b61e85142e3}\label{class_q_c_p_item_line_a17804b7f64961c6accf25b61e85142e3}} 
\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
\subsubsection{\texorpdfstring{Q\+C\+P\+Item\+Line()}{QCPItemLine()}}
{\footnotesize\ttfamily Q\+C\+P\+Item\+Line\+::\+Q\+C\+P\+Item\+Line (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} $\ast$}]{parent\+Plot }\end{DoxyParamCaption})}

Creates a line item and sets default values.

The constructed item can be added to the plot with \mbox{\hyperlink{class_q_custom_plot_aa500620379262321685cb7a7674cbd2a}{Q\+Custom\+Plot\+::add\+Item}}. 

\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_q_c_p_item_line_ae6cc5183f568e5fa9d7827abe4d405b5}\label{class_q_c_p_item_line_ae6cc5183f568e5fa9d7827abe4d405b5}} 
\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!select\+Test@{select\+Test}}
\index{select\+Test@{select\+Test}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
\subsubsection{\texorpdfstring{select\+Test()}{selectTest()}}
{\footnotesize\ttfamily double Q\+C\+P\+Item\+Line\+::select\+Test (\begin{DoxyParamCaption}\item[{const Q\+PointF \&}]{pos,  }\item[{bool}]{only\+Selectable,  }\item[{Q\+Variant $\ast$}]{details = {\ttfamily 0} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [virtual]}}

This function is used to decide whether a click hits a layerable object or not.

{\itshape pos} is a point in pixel coordinates on the \mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} surface. This function returns the shortest pixel distance of this point to the object. If the object is either invisible or the distance couldn\textquotesingle{}t be determined, -\/1.\+0 is returned. Further, if {\itshape only\+Selectable} is true and the object is not selectable, -\/1.\+0 is returned, too.

If the object is represented not by single lines but by an area like a \mbox{\hyperlink{class_q_c_p_item_text}{Q\+C\+P\+Item\+Text}} or the bars of a \mbox{\hyperlink{class_q_c_p_bars}{Q\+C\+P\+Bars}} plottable, a click inside the area should also be considered a hit. In these cases this function thus returns a constant value greater zero but still below the parent plot\textquotesingle{}s selection tolerance. (typically the selection\+Tolerance multiplied by 0.\+99).

Providing a constant value for area objects allows selecting line objects even when they are obscured by such area objects, by clicking close to the lines (i.\+e. closer than 0.\+99$\ast$selection\+Tolerance).

The actual setting of the selection state is not done by this function. This is handled by the parent \mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} when the mouse\+Release\+Event occurs, and the finally selected object is notified via the select\+Event/deselect\+Event methods.

{\itshape details} is an optional output parameter. Every layerable subclass may place any information in {\itshape details}. This information will be passed to select\+Event when the parent \mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} decides on the basis of this select\+Test call, that the object was successfully selected. The subsequent call to select\+Event will carry the {\itshape details}. This is useful for multi-\/part objects (like \mbox{\hyperlink{class_q_c_p_axis}{Q\+C\+P\+Axis}}). This way, a possibly complex calculation to decide which part was clicked is only done once in \mbox{\hyperlink{class_q_c_p_item_line_ae6cc5183f568e5fa9d7827abe4d405b5}{select\+Test}}. The result (i.\+e. the actually clicked part) can then be placed in {\itshape details}. So in the subsequent select\+Event, the decision which part was selected doesn\textquotesingle{}t have to be done a second time for a single selection operation.

You may pass 0 as {\itshape details} to indicate that you are not interested in those selection details.

\begin{DoxySeeAlso}{See also}
select\+Event, deselect\+Event, \mbox{\hyperlink{class_q_custom_plot_a5ee1e2f6ae27419deca53e75907c27e5}{Q\+Custom\+Plot\+::set\+Interactions}} 
\end{DoxySeeAlso}


Implements \mbox{\hyperlink{class_q_c_p_abstract_item_a96d522d10ffc0413b9a366c6f7f0476b}{Q\+C\+P\+Abstract\+Item}}.

\mbox{\Hypertarget{class_q_c_p_item_line_aebf3d687114d584e0459db6759e2c3c3}\label{class_q_c_p_item_line_aebf3d687114d584e0459db6759e2c3c3}} 
\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!set\+Head@{set\+Head}}
\index{set\+Head@{set\+Head}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
\subsubsection{\texorpdfstring{set\+Head()}{setHead()}}
{\footnotesize\ttfamily void Q\+C\+P\+Item\+Line\+::set\+Head (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending}} \&}]{head }\end{DoxyParamCaption})}

Sets the line ending style of the head. The head corresponds to the {\itshape end} position.

Note that due to the overloaded \mbox{\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending}} constructor, you may directly specify a \mbox{\hyperlink{class_q_c_p_line_ending_a5ef16e6876b4b74959c7261d8d4c2cd5}{Q\+C\+P\+Line\+Ending\+::\+Ending\+Style}} here, e.\+g.
\begin{DoxyCode}
\mbox{\hyperlink{class_q_c_p_item_line_aebf3d687114d584e0459db6759e2c3c3}{setHead}}(\mbox{\hyperlink{class_q_c_p_line_ending_a5ef16e6876b4b74959c7261d8d4c2cd5ab9964d0d03f812d1e79de15edbeb2cbf}{QCPLineEnding::esSpikeArrow}}) 
\end{DoxyCode}


\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_item_line_ac264222c3297a7efe33df9345c811a5f}{set\+Tail}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_item_line_a572528dab61c1abe205822fbd5db4b27}\label{class_q_c_p_item_line_a572528dab61c1abe205822fbd5db4b27}} 
\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!set\+Pen@{set\+Pen}}
\index{set\+Pen@{set\+Pen}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
\subsubsection{\texorpdfstring{set\+Pen()}{setPen()}}
{\footnotesize\ttfamily void Q\+C\+P\+Item\+Line\+::set\+Pen (\begin{DoxyParamCaption}\item[{const Q\+Pen \&}]{pen }\end{DoxyParamCaption})}

Sets the pen that will be used to draw the line

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_item_line_a3e2fec44503277e77717e9c24f87f1ea}{set\+Selected\+Pen}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_item_line_a3e2fec44503277e77717e9c24f87f1ea}\label{class_q_c_p_item_line_a3e2fec44503277e77717e9c24f87f1ea}} 
\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!set\+Selected\+Pen@{set\+Selected\+Pen}}
\index{set\+Selected\+Pen@{set\+Selected\+Pen}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
\subsubsection{\texorpdfstring{set\+Selected\+Pen()}{setSelectedPen()}}
{\footnotesize\ttfamily void Q\+C\+P\+Item\+Line\+::set\+Selected\+Pen (\begin{DoxyParamCaption}\item[{const Q\+Pen \&}]{pen }\end{DoxyParamCaption})}

Sets the pen that will be used to draw the line when selected

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_item_line_a572528dab61c1abe205822fbd5db4b27}{set\+Pen}}, \mbox{\hyperlink{class_q_c_p_abstract_item_a203de94ad586cc44d16c9565f49d3378}{set\+Selected}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_item_line_ac264222c3297a7efe33df9345c811a5f}\label{class_q_c_p_item_line_ac264222c3297a7efe33df9345c811a5f}} 
\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!set\+Tail@{set\+Tail}}
\index{set\+Tail@{set\+Tail}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
\subsubsection{\texorpdfstring{set\+Tail()}{setTail()}}
{\footnotesize\ttfamily void Q\+C\+P\+Item\+Line\+::set\+Tail (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending}} \&}]{tail }\end{DoxyParamCaption})}

Sets the line ending style of the tail. The tail corresponds to the {\itshape start} position.

Note that due to the overloaded \mbox{\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending}} constructor, you may directly specify a \mbox{\hyperlink{class_q_c_p_line_ending_a5ef16e6876b4b74959c7261d8d4c2cd5}{Q\+C\+P\+Line\+Ending\+::\+Ending\+Style}} here, e.\+g.
\begin{DoxyCode}
\mbox{\hyperlink{class_q_c_p_item_line_ac264222c3297a7efe33df9345c811a5f}{setTail}}(\mbox{\hyperlink{class_q_c_p_line_ending_a5ef16e6876b4b74959c7261d8d4c2cd5ab9964d0d03f812d1e79de15edbeb2cbf}{QCPLineEnding::esSpikeArrow}}) 
\end{DoxyCode}


\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_item_line_aebf3d687114d584e0459db6759e2c3c3}{set\+Head}} 
\end{DoxySeeAlso}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
R\+:/\+Develop/a0-\/develop/\+Lib\+Q\+Qt/src/charts/qcustomplot/\mbox{\hyperlink{qcustomplot_8h}{qcustomplot.\+h}}\item 
R\+:/\+Develop/a0-\/develop/\+Lib\+Q\+Qt/src/charts/qcustomplot/\mbox{\hyperlink{qcustomplot_8cpp}{qcustomplot.\+cpp}}\end{DoxyCompactItemize}
